<template>
  <view class="my-search-container" :style="{'background-color':bgcolor}">
    <view @click="clickHandler" :style="{'border-radius':radius+'rpx'}" class="my-search-box">
      <uni-icons type="search"></uni-icons>
      <text class="my-search-text">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name: "my-search",
    props: {
      // 背景颜色
      bgcolor: {
        type: String,
        default: '#C00000'
      },
      radius: {
        type: Number,
        default: 32
      }
    },
    data() {
      return {

      };
    },
    methods: {
      clickHandler() {

        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
  .my-search-container {
    display: flex;
    align-items: center;
    height: 100rpx;
    // background-color: #c00000;
    padding: 0 20rpx;

    .my-search-box {
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #fff;
      height: 72rpx;
      width: 100%;
      // border-radius: 36rpx;

      .my-search-text {
        margin-left: 10rpx;
      }
    }
  }
</style>
